package com.yswy.domain.entity.user;


import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "sys_permission")
@Api(tags = "权限")
public class Permission{
    @ApiModelProperty("父级")
    private Long pId;
    @ApiModelProperty("名称")
    private String name;
    @ApiModelProperty("权限名称")
    private String permissionName;
    @ApiModelProperty("权限类型（1:目录 2:菜单 3:按钮 4:接口）")
    private Integer permissionType;
    @ApiModelProperty("路由地址|接口地址|按钮K")
    private String path;
    @ApiModelProperty("组件路径|按钮V")
    private String component;
    @ApiModelProperty("icon")
    private String icon;
    @ApiModelProperty("重定向地址")
    private String redirect;
    @ApiModelProperty("排序")
    private Integer orderBy;
    @ApiModelProperty("是否缓存（0缓存 1不缓存）")
    private Integer isCache;
    @ApiModelProperty("是否隐藏 1:隐藏 0:不隐藏")
    private Integer isHidden;
    @ApiModelProperty("外链")
    private String link;
    @ApiModelProperty("冻结状态 true:冻结 false:不冻结")
    private Boolean freezingSatus;

    /** id s **/
    private Long id;
    @ApiModelProperty("创建时间")
    private Date createTime;
    @ApiModelProperty("创建人")
    private Long createBy;
    @ApiModelProperty("更新时间")
    private Date updateTime;
    @ApiModelProperty("更新人")
    private Long updateBy;

    @ApiModelProperty("是否删除 1:删除 0:未删除")
    private Integer isDel;

    public void create(Long optionId) {
        this.createBy = optionId;
        this.createTime = new Date();
    }
    public void update(Long optionId) {
        this.updateBy = optionId;
        this.updateTime = new Date();
    }
}
